from django.db import models
from utils.validators import xss_validator

class VulnerabilityDB(models.Model):
    vulnerabilityname = models.CharField(max_length=300,unique=True)
    vulnerabilityseverity = models.CharField(max_length=300)
    vulnerabilitydescription = models.TextField(validators=[xss_validator])
    vulnerabilitysolution = models.TextField(validators=[xss_validator])
    vulnerabilityreferlnk = models.TextField(blank=True,null=True,validators=[xss_validator])
    cvssscore = models.FloatField(blank=True,null=True)
    cvssvector = models.CharField(max_length=300,default=None,null=True)
    cwe = models.JSONField(null=True, blank=True)